home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks95 / RoysShamelessSelfpromot.sit / Roy’s Shameless Self-promotion / main.c next >
C/C++ Source or Header  |  1995-06-24  |  1KB  |  56 lines

  1. #include <Types.h>
  2. // Roy’s Shameless Self-promotion, MacHack 1995
  3.  
  4. #include <Memory.h>
  5. #include <Quickdraw.h>
  6. #include <Fonts.h>
  7. #include <Events.h>
  8. #include <Menus.h>
  9. #include <Windows.h>
  10. #include <TextEdit.h>
  11. #include <Dialogs.h>
  12. #include <OSUtils.h>
  13. #include <ToolUtils.h>
  14. #include <SegLoad.h>
  15.  
  16. void InitToolbox() {
  17.     InitGraf(&qd.thePort);
  18.     InitFonts();
  19.     FlushEvents(everyEvent, 0);
  20.     InitWindows();
  21.     InitMenus();
  22.     TEInit();
  23.     InitDialogs(0L);
  24.     InitCursor();
  25.     MaxApplZone();
  26.     }
  27.  
  28. void main() {
  29.   RgnHandle theRgn;
  30.   RGBColor niceColor,oldForeColor;  
  31.   int w,h;
  32.   
  33.     InitToolbox();
  34.  
  35.     theRgn = (RgnHandle)GetResource('RGNX',1024);
  36.  
  37.     OffsetRgn(theRgn, (qd.screenBits.bounds.right - qd.screenBits.bounds.left -
  38.                         (*theRgn)->rgnBBox.right),
  39.                        (qd.screenBits.bounds.bottom - qd.screenBits.bounds.top -
  40.                         (*theRgn)->rgnBBox.bottom));
  41.     
  42.     GetWMgrPort(&qd.thePort);
  43.     
  44.     niceColor.red = 65535;
  45.     niceColor.green = 0;
  46.     niceColor.blue = 65535;
  47.     
  48.     GetForeColor(&oldForeColor);
  49.     RGBForeColor(&niceColor);
  50.     FillRgn(theRgn, &qd.black);    
  51.  
  52.     DiffRgn(GetGrayRgn(), theRgn, GetGrayRgn());
  53.  
  54.     RGBForeColor(&oldForeColor);
  55.     }
  56.